home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
clipper
/
ks94an.zip
/
ARRAYTXT.HDR
< prev
next >
Wrap
Text File
|
1994-04-25
|
3KB
|
103 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_ArrayText( acArray, cFile, nWidth, lAppend ) --> nElementsWritten
PARAMETERS:
acArray : Single Dimension Array to be written to text file
cFile : File to write/append to
nWidth : Maximum width of elements to write (DEFAULT 1024)
lAppend : FALSE = Replace File
TRUE = Append to File
SHORT:
Write an array to a text file.
DESCRIPTION:
_ArrayText() is the opposite of _TextArray(). It takes an array and writes
it to a disk file.
The array need not be exclusively composed of character elements.
All non-character elements are converted to character type. All
elements converted to string are "alltrim()ed". Logical values become "Y"
or "N" in the output file.
if nWidth is specified, then only the first nWidth characters of the
element (after stringifying for non-char types) is written to each line in
the output file. If nWidth is not specified, then the entire array
element, up to 1024 characters, is written.
If lAppend is TRUE, the array is added to the bottom of the output file if
it exists. If lAppend is FALSE, then the output file is overwritten.
Unlike _TextArray(), _ArrayText() must be supplied with the name of a
file that is !NOT OPEN!
_ArrayText() returns the number of array elements written.
NOTE:
EXAMPLE:
LOCAL acArray := {}
acArray = _TextArray('AUTOEXEC.BAT')
aadd(acArray,'SET U_NAME=KWALLACE')
_ArrayText(acArray, 'AUTOEXEC.BAT')
Result: AUTOEXEC.BAT is replaced with a copy of the original with
an additional line (SET U_NAME=KWALLAC) added.
AUTOEXEC.BAT BEFORE:
@ECHO OFF
PROMPT $P$G
PATH=C:\DOS
C:\C600\BINB
C:\C600\BIN
C:\UT
C:\CLIPPER5\BIN
lh \dos\doskey
SET CLIPPER=F95
E00
SET OBJ=C:\CLIPPER5\OBJ
SET PLL=C:\CLIPPER5\INCLUDE
SET LIB=C:\C600\LIB
C:\CLIPPER5\LIB
SET INCLUDE=C:\C600\INCLUDE
C:\CLIPPER5\INCLUDE
c:\apps\clip_inc
AUTOEXEC.BAT AFTER:
@ECHO OFF
PROMPT $P$G
PATH=C:\DOS
C:\C600\BINB
C:\C600\BIN
C:\UT
C:\CLIPPER5\BIN
lh \dos\doskey
SET CLIPPER=F95
E00
SET OBJ=C:\CLIPPER5\OBJ
SET PLL=C:\CLIPPER5\INCLUDE
SET LIB=C:\C600\LIB
C:\CLIPPER5\LIB
SET INCLUDE=C:\C600\INCLUDE
C:\CLIPPER5\INCLUDE
c:\apps\clip_inc
SET U_NAME=KWALLACE
******************************************************************************/